| Conditions | 2 |
| Total Lines | 20 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | 3 | import Twit from 'twit'; |
|
| 27 | |||
| 28 | async retweet(searchParams: Twit.Params): Promise<void> { |
||
| 29 | 1 | const like = new Like(this.config, this.twit, this.debug); |
|
| 30 | 1 | const likeOnSuccess = async(tweet: Tweet) => await like.run({ |
|
| 31 | tweet |
||
| 32 | }); |
||
| 33 | |||
| 34 | 1 | const retweet = new Retweet(this.config, this.twit, this.debug); |
|
| 35 | 1 | const retweetOnSuccess = async(tweet: Tweet) => await retweet.run({ |
|
| 36 | tweet, |
||
| 37 | onSuccess: likeOnSuccess |
||
| 38 | }); |
||
| 39 | |||
| 40 | 1 | const search = new Search(this.config, this.twit, this.debug); |
|
| 41 | 1 | await search.run({ |
|
| 42 | searchParams, |
||
| 43 | onSuccess: retweetOnSuccess |
||
| 44 | }); |
||
| 45 | |||
| 46 | 1 | this.debug('All done.'); |
|
| 47 | } |
||
| 48 | } |